Skip to content

GET /api/agent/credit-notes/{id} ​

Drill into one credit note of either side by its Xero GUID (externalId) OR its creditNoteNumber. Returns the list shape (including type) plus lineItems (nullable — null when the line-item sync fetch hasn't yet succeeded) and allocations[] (the invoices or bills it's been applied to, with amount + date). A GUID is unique. A number may match several credit notes — supplier numbers are the supplier's own and often collide with customer CN numbers — in which case the response is 409 { error: "ambiguous", candidates: [{ externalId, type, contactName, xeroStatus }] }; re-request with the chosen externalId. If several match but exactly one is not VOIDED/DELETED, that one is returned (200) instead. A sensitive credit note — sensitive contact, or ANY line coded to a sensitive account (at least as strict as invoices/bills: line accounts always checked, codes trimmed) — is invisible without READ_SENSITIVE: it returns 404 when it is the only match and is omitted from (and not counted toward) a 409.

Auth ​

  • Required scope: READ_INVOICES
  • Header: Authorization: Bearer cr_live_<prefix>_<secret>

Query parameters ​

NameTypeRequiredNotes
idstringyesXero CreditNoteID (GUID) or CreditNoteNumber (e.g. CN-####). Prefer the GUID for supplier credits.

Responses ​

200 — The credit note with line items + allocations. ​

Body: CreditNoteDrillResponse

FieldTypeRequiredNotes
creditNoteCreditNoteDrillyes
redactedItemCountintegeryesAlways 0 on the drill: a sensitive credit note (sensitive contact, or any line on a sensitive account) is hidden in full — 404 — rather than returned with redactions. Kept for wire-shape parity with the list, where it counts dropped rows.
billingAlertBillingAlertno
xeroAlertXeroAlertno

401 — Unauthorized ​

Body: ErrorResponse

FieldTypeRequiredNotes
errorstringyes

404 — Not found, or sensitive without READ_SENSITIVE. ​

409 — The credit-note number matched more than one visible credit note. Re-request by one candidate's externalId. ​

Body: CreditNoteAmbiguousResponse

FieldTypeRequiredNotes
errorstring · one of ambiguousyes
candidatesarray of objectyes

429 — Rate-limited (per-minute burst) or query credits exhausted. Credits return individually on a rolling 5h window — retry after Retry-After seconds for one more call. ​

Body:

any

Response headers ​

Every successful response carries X-CashRunway-Subscription, X-CashRunway-Plan, X-CashRunway-Quota-Remaining, and X-CashRunway-Quota-Reset. Trialing subscriptions also include X-CashRunway-Trial-Days-Remaining. See the overview for details.

Released under a proprietary license. · cashrunway.ai